home *** CD-ROM | disk | FTP | other *** search
- This package is an in-progess implementation of the C++
- iostream library, as well as an implementation of C stdio.
-
- The entire package is Copyright Per Bothner 1991, except
- where explicitly noted. Note that some code is derived
- from the Chris Torek's stdio implementation for BSD 4.4,
- developed by the University of California, Berkeley.
- I have not put copyright notices in all of the files yet.
- The licensing terms are those of the GNU Library License.
- If those terms are unacceptable, contact me;
- we can probably work out an alternative.
-
- The package is far from complete, but it allows useful work.
- See the TODO file for list of things missing.
-
- FEATURES:
-
- * Full implementation of ANSI C stdio. (Mostly done.)
- * Full implementation of the streambuf layer of AT&T's
- iostream library for C++. (Mostly done.)
- * Impementation of most of the iostream layer of AT&T's
- iostream library. I will track the ANSI standard, and
- implement more as the details get firmer.
- * Full compatibility between stdio and streambufs.
- All stdio routines are implemented by coering the
- (FILE*) argument to a (streambuf*), and then doing
- streambuf operations. You can do the same: For example,
- if you have a streambuf* sb, you can do fprintf((FILE*)sb, ...).
- Also, (streambuf*)stdin == cin->rdbuf(), so you never need
- to synchonize streams and stdio.
- * Binary compatibility with the old _iob implementation of stdio.
- Thus you can link with libraries compiled for old C libraries.
- (There is also binary compatibility with the unreleased GNU libc.)
- * A parsebuf sub-class of streambuf that is tailored for parsing
- and scanning text: It keeps track of line numbers, and provides
- full access to the current input line with arbitrary seeks and
- unget/putback within the current line.
- * A string buffer class using an Emacs-style buffer gap.
- It provides first-class sub-strings and buffer markers.
- There is also an editbuf sub-class of streambuf that allows
- any number of streams to read or write in a buffer or a sub-string.
-
- INSTALLATION:
-
- I have only tried to install the system on a 68020-based Sony
- running NewsOS-3, a BSD-4.3 derivate. I have used a pre-release
- of GNU libc, so if you're using an older libc, you might be
- mising some routines.
-
- Note that the default configuration redefines the stdio part of libc.
- This may cause problems with routines in libc that call stdio
- routines; they may get the wrong (libc) version.
- Ideally, iostream should be be integrated with some libc
- implementation, replacing the stdio portion of the library;
- that has not been done yet. If you don't want the iostream stdio
- implementation at all, follow the instruction in the section below.
-
- The file ioconfig.h is intended to contain configuration flags.
- You may also want to hack streambuf.C if you prefer an
- alternative way to forcing flushes (via the call to flush_all())
- on exit(). The current scheme uses a static destructor for the
- variable io_defs__ which is of the dummy class __io_defs.
- The disadvantage is that it requires that the main program be a C++ file,
- so this is not suitable if you want to use iostream as the
- default implementation of stdio.
-
- INSTALLING WITHOUT THE STDIO IMPLEMENTATION:
-
- By default, the library includes a almost-complete implementation
- of the stdio library for ANSI standard C. It includes an
- emulation trick so that you can use this implementation
- of stdio with files and libraries that have been compiled
- for some other implementation. See the file emulatate.C
- for details.
-
- However, there is still a problem if when linking you
- search libio.a before libc.a, if you use routines in
- libc.a that need stdio routines that you don't call
- directly. In that case the libc version of the stdio
- routine will be linked in, and it might not work here.
- Futhermore, the emulation may be slower (it works
- by tricking putc and getc to call a subroutine on
- each character. For these reasons you may prefer to
- create a version of libio.a without the stdio stuff.
-
- Doing so has not been fully tested yet, but the
- the following may suffice:
- 1) Comment out the line defining DO_STDIO_OBS in the Makefile.
- 2) Uncomment the definition of IMPLEMENT_STDIO in ioconfig.h.
- 3) Rename stdio.h to __stdio.h.
-
- Send bug reports to Per Bothner. Until August 7 1991, send
- mail to bothner@cs.wisc.edu. After then, bothner@cygnus.com.
- Also, send Makefiles for other configurations.
-